function foo(arg: number): number {
  return 1
}

// 1. 函数类型表达式
// (参数列表) => 返回值
type BarType = (num1: number, num2: number) => number
const bar: BarType = (arg: number): number => {
  return 2
}

// 练习
type CalcType = (num1: number, num2: number) => number

function calc(calcFn: CalcType) {
  const num1 = 10
  const num2 = 10
  calcFn(num1, num2)
}

function sum(num1: number, num2:number) {
  return num1 + num2
}
calc(sum)
// TypeScript对传入的函数类型的参数个数不进行个数检测

export{}